package mybatis.service;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class FactoryService {
	private static SqlSessionFactory factory;
	 static{
		 try {
			factory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsReader("mybatis/config/configuration.xml"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	 }
	public static SqlSessionFactory getFactory() {
		return factory;
	}	
}
